-
Notifications
You must be signed in to change notification settings - Fork 544
[SDK] Fix: Automatically trigger login for connected wallets whe… #7009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDK] Fix: Automatically trigger login for connected wallets whe… #7009
Conversation
…n auth is required 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: a3a9e63 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
Merge activity
|
// if the wallet is connected and auth is required, trigger a login attempt automatically | ||
useEffect(() => { | ||
if ( | ||
activeAccount && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only do this for in app wallets. Coz on mobile you really need an explicit click otherwise things break quickly.
@@ -410,6 +412,28 @@ function ConnectButtonInner( | |||
} | |||
}, [activeAccount]); | |||
|
|||
// if an IAW wallet is connected and auth is required, trigger a login attempt automatically | |||
useEffect(() => { | |||
const isIAW = activeWallet?.id === "inApp" || adminWallet?.id === "inApp"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have a helper for this? That handles smart and ecosystem too
3da99c7
to
8994dba
Compare
size-limit report 📦
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7009 +/- ##
==========================================
- Coverage 54.60% 54.60% -0.01%
==========================================
Files 903 904 +1
Lines 57936 57960 +24
Branches 3970 3969 -1
==========================================
+ Hits 31637 31648 +11
- Misses 26198 26211 +13
Partials 101 101
🚀 New features to boost your workflow:
|
8994dba
to
3edf931
Compare
}); | ||
manager.addConnectedWallet(wallet); | ||
} catch { | ||
// no-op | ||
} | ||
} | ||
|
||
// Auto-login with SIWE | ||
if (urlToken && activeWallet && props.siweLogin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to check if it actually requires auth here too. I think you can pass the require auth function down as well maybe?
/** | ||
* @hidden | ||
*/ | ||
siweLogin?: () => Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need this?
}); | ||
manager.addConnectedWallet(wallet); | ||
} catch { | ||
// no-op | ||
} | ||
} | ||
|
||
// Auto-login with SIWE | ||
if (urlToken && activeWallet && props.siweAuth?.requiresAuth) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to invoke this? I thought it was a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do the same logic that would trigger the sign in button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a function, it just checks if they're using SIWE
…n auth is required
🤖 Generated with Claude Code
PR-Codex overview
This PR introduces automatic SIWE (Sign-In with Ethereum) authentication when a wallet is connected, enhancing user experience by streamlining the login process.
Detailed summary
siweAuth
options to various components for handling SIWE authentication.ConnectButton
andConnectEmbed
to utilizesiweAuth
.isInAppSigner
function to determine in-app wallet status.autoConnectCore
to support SIWE login logic.